package com.cskaoyan.converter;

import com.cskaoyan.bean.User2;
import org.springframework.core.convert.converter.Converter;

/**
 * @author stone
 * @date 2022/07/13 11:39
 */
// 2 → two → to
public class String2User2Converter implements Converter<String, User2> {
    @Override
    public User2 convert(String s) {
        User2 user2 = new User2();
        user2.setUsername(s);
        user2.setPassword(s);
        return user2;
    }
}
